from handler.HandlerBase import HandlerBase
import redis


class Redis(HandlerBase):
	def __init__(self, content):
		host = content['host']
		port = content['port']
		db = content['db']
		password = content['password']

		self._client = redis.Redis(host=host, port=port, db=db, password=password)

	def change_state(self, from_state, to_state):
		self._client.lpush('action', to_state)
